home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 21
/
Cream of the Crop 21 (Terry Blount) (October 1996).iso
/
bbs
/
pad311.zip
/
STRIPSTR.MH
< prev
next >
Wrap
Text File
|
1996-08-21
|
787b
|
27 lines
#ifndef __STRIPSTR_MH
#define __STRIPSTR_MH
// stripStr removes all occourances of a number of characters from a string.
// theString is the string being stripped, and stripStr contains the characters
// to be removed from theString.
void stripStr (Ref string: theString, string: stripStr) {
int: sidx, tidx, stripidx, found;
tidx := 1;
for (sidx := 1; sidx <= strlen (theString); sidx := sidx + 1) {
found := False;
for (stripidx := 1; stripidx <= strlen (stripStr); stripidx := stripidx + 1) {
if (theString [sidx] = stripStr [stripidx])
found := True;
};
if (found = False) {
theString [tidx] := theString [sidx];
tidx := tidx + 1;
};
};
theString := substr (theString,1,tidx-1);
}
#endif